<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        //浅拷贝：把对象第一层的属性和值，拷贝给另一个对象
        let obj1 = {title:'aaaaaa',subject:'前端'}
        // ---------------直接赋值 ----------------
        // let obj2 = obj1 //(直接赋值，赋值的是地址)
        // obj2.title = 'bbbbbbb'

        //---------------浅拷贝 -------------------
        let obj2 = {
            uname:'aa',
            age:20,
            ...obj1
        }
        obj2.title = 'bbbbbbbbbb'
        console.log(obj1,obj2);
    </script>
</body>
</html>